//
//  JTCSM.h
//  JTCSM
//
//  Created by  程 强 on 15/9/11.
//  Copyright (c) 2015年 demon. All rights reserved.
//

#ifndef JTCSM_JTCSM_h
#define JTCSM_JTCSM_h

#import "UILabel+Custom.h"
#import "UITextField+Custom.h"
#import "leftBarButtonItems+rightBarButtonItems.h"
#import "df.h"
#import "JTCSMSingle.h"
#import <WHC_AutoLayoutKit/UITableViewCell+WHC_AutoHeightForCell.h>
#import <WHC_Model/NSObject+WHC_Model.h>
#import "UIButton+addPro.h"
#import "AFNetworking.h"
#import "UIImageView+WebCache.h"
#import "LoadData.h"
#import "WebViewController.h"


#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON

#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
#define KZhuTiRGB  RGBACOLOR(255,208,24, 1)
#define KUSERDEFAULTSET(value,key)  [[NSUserDefaults standardUserDefaults] setObject:value forKey:key]
#define KUSERDEFAULTGET(key)        [[NSUserDefaults standardUserDefaults] objectForKey:key]
#define KUSERDEFAULTRemoveAll(key)  [[NSUserDefaults standardUserDefaults] removeObjectForKey:key]
#define  KuserInfo @"userinfo"
#define  Khtml_user @"html_user"
#define KTokenString  [[[NSUserDefaults standardUserDefaults] objectForKey:KuserInfo] objectForKey:@"token"]
#define KHkTellString  [[[NSUserDefaults standardUserDefaults] objectForKey:KuserInfo] objectForKey:@"hkTell"]
#define KHkNameString  [[[NSUserDefaults standardUserDefaults] objectForKey:KuserInfo] objectForKey:@"hkName"]
#define KHkTypeString  [[[NSUserDefaults standardUserDefaults] objectForKey:KuserInfo] objectForKey:@"hkType"]
#define KhkTypeStrString  [[[NSUserDefaults standardUserDefaults] objectForKey:@KuserInfo] objectForKey:@"hkTypeStr"]
#define KhousekeeperIdString  [[[NSUserDefaults standardUserDefaults] objectForKey:KuserInfo] objectForKey:@"housekeeperId"]
#define KidString  [[[NSUserDefaults standardUserDefaults] objectForKey:KuserInfo] objectForKey:@"id"]
#define KisOwnerString  [[[NSUserDefaults standardUserDefaults] objectForKey:KuserInfo] objectForKey:@"isOwner"]

#define KCONTROLLERWith self.view.frame.size.width//控制器视图的宽
#define KCONTROLLERHeight self.view.frame.size.height//控制器视图的高
#define KVIEWwith self.frame.size.width//视图的宽
#define KVIEWheight self.frame.size.height//视图的高
#define KSCREENWidth (CGFloat)[UIScreen mainScreen].bounds.size.width //windon宽
#define KSCREENHeight [UIScreen mainScreen].bounds.size.height //windon高
#define KVIEW_X(a)          a.frame.size.width + a.frame.origin.x
#define KVIEW_Y(a)          a.frame.size.height + a.frame.origin.y

#define KVIEWOrigin_X(a)    a.frame.origin.x
#define KVIEWOrigin_Y(a)    a.frame.origin.y

#define Kspace 20
#define KAutoSize(a) a*KSCREENWidth/375.0
#define KAlertVTag 78348945969

#define KFloatMoney(a) @"%.2f¥",[a floatValue]
#define KTurnToString(a) [NSString stringWithFormat:@"%@",a]

#define KCUSTOMNAVIGSTION_ALLOC [[leftBarButtonItems_rightBarButtonItems alloc]init];//自定义navigation
#define KLeftBarButtonItemFrame_text CGRectMake(10,12,20,20) //leftbar
#define KRightBarButtonItemFrame_text CGRectMake(0,2,40,40)

#define KLeftimageFrame CGRectMake(35,12,20,20)
#define KRightBarButtonItemFrame_image CGRectMake(0,12,20.4,17)//rightbar
#define KWEBURLHEADER(a) [NSString stringWithFormat:@"https://www.miaomaifang.com/hk-app/sellHouseAPP/ui/%@",a]
#define KURLHEADER @"https://www.miaomaifang.com/hk-app/"
//#define KWEBURLHEADER(a) [NSString stringWithFormat:@"http://114.115.217.70:8080/sellHouseAPP/ui/%@",a]
//#define KURLHEADER @"http://22798jk453.iok.la/hk-app/"
#define KURLPOSTHeadr(a) [NSString stringWithFormat:@"%@%@",KURLHEADER,a]
#define KRESULTCODE [[result objectForKey:@"resultCode"] integerValue]
#define KResponseCode [[responseObject objectForKey:@"resultCode"] integerValue]
#define KResponseData [responseObject objectForKey:@"data"]
#define KImageUrl(a) [NSURL URLWithString:[a containsString:@"http://"]?a:[NSString stringWithFormat:@"%@%@",KURLHEADER,a]]





































//判断是否是ipad
#define isPad ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
//判断iPhone4系列
#define kiPhone4 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
//判断iPhone5系列
#define kiPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
//判断iPhone6系列
#define kiPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
//判断iphone6+系列
#define kiPhone6Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
//判断iPhoneX
#define IS_IPHONE_X ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
//判断iPHoneXr
#define IS_IPHONE_Xr ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
//判断iPhoneXs
#define IS_IPHONE_Xs ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
//判断iPhoneXs Max
#define IS_IPHONE_Xs_Max ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)

#define Height_StatusBar ((IS_IPHONE_X==YES || IS_IPHONE_Xr ==YES || IS_IPHONE_Xs== YES || IS_IPHONE_Xs_Max== YES) ? 44.0 : 20.0)
#define Height_NavBar ((IS_IPHONE_X==YES || IS_IPHONE_Xr ==YES || IS_IPHONE_Xs== YES || IS_IPHONE_Xs_Max== YES) ? 88.0 : 64.0)
#define Height_TabBar ((IS_IPHONE_X==YES || IS_IPHONE_Xr ==YES || IS_IPHONE_Xs== YES || IS_IPHONE_Xs_Max== YES) ? 83.0 : 49.0)


#endif


#define KLeftBarButtonItemFrame_image CGRectMake(0, Height_StatusBar, 44, 44)
